package com.liuche.pictureserver.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 审核状态枚举
 *
 * @author liuche
 */
@Getter
@AllArgsConstructor
public enum ReviewStatusEnum {
    REVIEW_PENDING(0, "待审核"),
    REVIEW_PASS(1, "审核通过"),
    REVIEW_FAIL(2, "审核不通过"),
    ;
    private final Integer code;
    private final String desc;

    public static ReviewStatusEnum getByCode(Integer code) {
        for (ReviewStatusEnum value : ReviewStatusEnum.values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
